package com.example.demo.service;

import com.example.demo.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
public class UserService {
//    public void say(){
//        System.out.println("this is UserService");
//    }

//    @Primary
    @Bean("u1")
    public User user1(){
        User user=new User();
        user.setName("Maybe");
        user.setAge(15);
        return user;
    }
    @Bean
    public User user2(){
        User user=new User();
        user.setName("lisi");
        user.setAge(18);
        return user;
    }

}
